package com.haiyi.activiti.engine.query.impl;

import com.haiyi.activiti.engine.model.entity.User;
import com.haiyi.activiti.engine.framework.database.AbstractQuery;
import com.haiyi.activiti.engine.query.UserQuery;
import com.haiyi.activiti.engine.service.IUserService;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * <p> </p>
 *
 * <pre> Created: 2018/12/4 17:10 </pre>
 *
 * @author hlu
 * @version 1.0
 * @since JDK 1.7
 */
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class UserQueryImpl extends AbstractQuery<UserQuery,User,IUserService> implements UserQuery {

    private String iid;
    private String loginName;
    private String password;
    private String name;
    private Date updateTime;
    private Date createTime;
    private Date updateTimeBefore;
    private Date updateTimeAfter;
    private Date createTimeBefore;
    private Date createTimeAfter;
    private String deleteFlag;
    private String updater;
    private String creater;
    private String status;
    private String tokenExpire;
    private String roleName;
    private String[] roleNames;
    private String roleId;
    private String[] roleIds;


    @Override
    public UserQuery userId(String iid) {
        this.iid = iid;
        return this;
    }

    @Override
    public UserQuery loginName(String loginName) {
        this.loginName = loginName;
        return this;
    }

    @Override
    public UserQuery password(String password) {
        this.password = password;
        return this;
    }

    @Override
    public UserQuery deleteFlag(String deleteFlag) {
        this.deleteFlag = deleteFlag;
        return null;
    }

    @Override
    public UserQuery updater(String updater) {
        this.updater = updater;
        return this;
    }

    @Override
    public UserQuery creater(String creater) {
        this.creater = creater;
        return this;
    }

    @Override
    public UserQuery status(String status) {
        this.status = status;
        return this;
    }

    @Override
    public UserQuery tokenExpire(String tokenExpire) {
        this.tokenExpire = tokenExpire;
        return this;
    }

    @Override
    public UserQuery name(String name) {
        this.name = name;
        return this;
    }

    @Override
    public UserQuery roleName(String shortName) {
        this.roleName = shortName;
        return this;
    }

    @Override
    public UserQuery roleNameContains(String... shortNames) {
        this.roleNames = shortNames;
        return this;
    }

    @Override
    public UserQuery roleId(String roleId) {
        this.roleId = roleId;
        return this;
    }

    @Override
    public UserQuery roleIdContains(String... roleIds) {
        this.roleIds = roleIds;
        return this;
    }

    @Override
    public UserQuery createTime(Date date) {
        this.createTime = date;
        return this;
    }

    @Override
    public UserQuery createTimeBefore(Date date) {
        this.createTimeBefore = date;
        return this;
    }

    @Override
    public UserQuery createTimeAfter(Date date) {
        this.createTimeAfter = date;
        return this;
    }

    @Override
    public UserQuery updateTime(Date date) {
        this.updateTime = date;
        return this;
    }

    @Override
    public UserQuery updateTimeBefore(Date date) {
        this.updateTimeBefore = date;
        return this;
    }

    @Override
    public UserQuery updateTimeAfter(Date date) {
        this.updateTimeAfter = date;
        return this;
    }

    public String getIid() {
        return iid;
    }

    public String getLoginName() {
        return loginName;
    }

    public String getPassword() {
        return password;
    }

    public String getName() {
        return name;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public String getDeleteFlag() {
        return deleteFlag;
    }

    public String getUpdater() {
        return updater;
    }

    public String getCreater() {
        return creater;
    }

    public String getStatus() {
        return status;
    }

    public String getTokenExpire() {
        return tokenExpire;
    }

    public Date getUpdateTimeBefore() {
        return updateTimeBefore;
    }

    public Date getUpdateTimeAfter() {
        return updateTimeAfter;
    }

    public Date getCreateTimeBefore() {
        return createTimeBefore;
    }

    public Date getCreateTimeAfter() {
        return createTimeAfter;
    }

    public String getRoleName() {
        return roleName;
    }

    public String[] getRoleNames() {
        return roleNames;
    }

    public String getRoleId() {
        return roleId;
    }

    public String[] getRoleIds() {
        return roleIds;
    }
}
